package inference.traffic;

import java.util.ArrayList;

import rddl.EvalException;
import rddl.RDDL.LCONST;
import rddl.RDDL.PVAR_INST_DEF;
import rddl.RDDL.PVAR_NAME;
import rddl.RDDL.TYPE_NAME;
import rddl.State;
import rddl.policy.Policy;
import util.Pair;

public class AdvancePolicy extends Policy{

	@Override
	public ArrayList<PVAR_INST_DEF> getActions(State s) throws EvalException {
		
		ArrayList<PVAR_INST_DEF> ret = new ArrayList<PVAR_INST_DEF>();
		
//		System.out.println( s.toString() );

		TYPE_NAME intersection_type = new TYPE_NAME("intersection");
		ArrayList<LCONST> intersections = s._hmObject2Consts.get(intersection_type);

		for( LCONST xion : intersections ){
			
			ArrayList<LCONST> thisXion = new ArrayList<LCONST>();
			thisXion.add( xion );
			
			ret.add( new PVAR_INST_DEF("flip-light-signal1", true, thisXion) );
			ret.add( new PVAR_INST_DEF("flip-light-signal2", true, thisXion) );
			
		}
		
		return ret;
		
	}
	

}
